package com.example.alaporres;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity implements OnClickListener{

	private TextView mUserName;
	private String mUserImage;
	private String mUserInfo;
	
	Button btn_Recruit, btn_Attack;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		setContentView(R.layout.activity_main);
		Intent intent = getIntent();
		String username = intent.getStringExtra("username");
		mUserName = (TextView)findViewById(R.id.username);
		mUserName.setText(username);
		
		btn_Recruit = (Button) findViewById(R.id.recruit);
		btn_Recruit.setOnClickListener(this);
		
		btn_Attack = (Button) findViewById(R.id.attack);
		btn_Attack.setOnClickListener(this);
				
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

	public void showArmy(View view) {
		Intent intent = new Intent(this, ArmyActivity.class);
		startActivity(intent);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.recruit:
		{
			startActivity(new Intent(MainActivity.this, RecruitListActivity.class));
		}
			
			break;
			
		case R.id.attack:
		{
			startActivity(new Intent(MainActivity.this, VenuesToAttackActivity.class));
		}
			
			break;

		default:
			break;
		}
		
	}

}
